package com.ybxx.base.service.impl;

import java.util.List;

import com.ybxx.base.dao.UnitDao;
import com.ybxx.base.model.Unit;
import com.ybxx.base.service.UnitService;
import com.ybxx.core.command.QueryFilter;
import com.ybxx.core.dao.GenericDao;
import com.ybxx.core.service.impl.BaseServiceImpl;
import com.ybxx.core.web.paging.PagingBean;

public class UnitServiceImpl extends BaseServiceImpl<Unit> implements
		UnitService {
	private UnitDao unitDao;
	public UnitServiceImpl(UnitDao dao) {
		super(dao);
		this.unitDao=dao;
		// TODO Auto-generated constructor stub
	}
	public List<Unit> queryTree(String bid, String loginid){
		String hql="select distinct u from Unit as u,DataRights m where u.uid=m.dvalue and m.dtype='U' and u.ban.bid='"+bid+"' and m.user.loginid='"+loginid+"'";
		hql+=" order by u.uname";
		return this.unitDao.findByHql(hql, null);
	}
}
